package com.example.play.api

import com.example.http.CommonHttpRetrofitAnnotation
import com.example.http.RetrofitManager
import com.example.http.TokenHttpRetrofitAnnotation
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import javax.inject.Singleton

/**
 * 详情接口模块
 */
@Module
@InstallIn(SingletonComponent::class)
object  PlayServerModule {

    /**
     * 通过依赖注入的方式传递进来一个Retrofit对象，然后返回接口实例
     */
    @Provides
    @Singleton
    fun getPlayApiServer(@TokenHttpRetrofitAnnotation retrofit: Retrofit): PlayApiServer =retrofit.create(PlayApiServer::class.java)
}